import ITool from '../ITool';
import PmsBdz from './symbols/PmsBdz';
import PmsDldl from './symbols/PmsDldl';
import PmsDlfzx from './symbols/PmsDlfzx';
import PmsDlld from './symbols/PmsDlld';
import PmsHwg from './symbols/PmsHwg';
import PmsJkxl from './symbols/PmsJkxl';
import PmsKgz from './symbols/PmsKgz';
import PmsPds from './symbols/PmsPds';
import PmsPjd from './symbols/PmsPjd';
import PmsTjd from './symbols/PmsTjd';
import PmsXsbdz from './symbols/PmsXsbdz';
import PmsZsbyq from './symbols/PmsZsbyq';
import PmsZsdlq from './symbols/PmsZsdlq';
import PmsZsfhkg from './symbols/PmsZsfhkg';

/**
 * 电网设备绘制工具箱
 */
class PowerGridTool extends ITool {
  constructor(_top, _impl) {
    super(_top, _impl);
    this.name = 'PowerGridTool';
    this.desc = '电力符号绘制工具箱';
    this.gridTool = 'SimpleGridTool';
    this.editFeatures = null;
    this.option = {};
  }

  onAdd() {
    super.onAdd();
  }

  onRemove() {
    super.onRemove();
  }

  /**
     * 设置默认参数
     * @param {Object} option 参数
     */
  setOption(option) {
    this.option = option;
  }

  /**
     * 设置电网网架展示工具
     * @param {String} toolname 电网网架展示工具名称
     */
  setGridTool(toolname) {
    this.gridTool = toolname;
  }

  /**
     * 变电站录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  drawBdz(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsBdz(this).draw(opts, snapList);
  }

  /**
     * 架空线路录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     * @param {Array} ignoreSbzlx 捕捉图形中不包含该数组中设备子类型设备
     */
  drawJkxl(option, snapList, ignoreSbzlx) {
    let opts = Object.assign({}, this.option, option);
    return new PmsJkxl(this).draw(opts, snapList, ignoreSbzlx);
  }

  /**
     * 电力电缆录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     * @param {Array} ignoreSbzlx 捕捉图形中不包含该数组中设备子类型设备
     */
  drawDldl(option, snapList, ignoreSbzlx) {
    let opts = Object.assign({}, this.option, option);
    return new PmsDldl(this).draw(opts, snapList, ignoreSbzlx);
  }

  /**
     * 开关站录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  drawKgz(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsKgz(this).draw(opts, snapList);
  }

  /**
     * 环网柜录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  drawHwg(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsHwg(this).draw(opts, snapList);
  }

  /**
     * 电缆分支箱录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  drawDlfzx(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsDlfzx(this).draw(opts, snapList);
  }

  /**
     * 柱上断路器录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  drawZsdlq(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsZsdlq(this).draw(opts, snapList);
  }

  /**
     * 柱上负荷开关录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  drawZsfhkg(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsZsfhkg(this).draw(opts, snapList);
  }

  /**
     * 电缆廊道录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  drawDlld(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsDlld(this).draw(opts, snapList);
  }

  /**
     * 柱上变压器录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  drawZsbyq(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsZsbyq(this).draw(opts, snapList);
  }

  /**
     * 箱式变电站录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  drawXsbdz(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsXsbdz(this).draw(opts, snapList);
  }

  /**
     * 配电室录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  drawPds(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsPds(this).draw(opts, snapList);
  }


  /**
     * T接点录入
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  drawTjd(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsTjd(this).draw(opts, snapList);
  }

  drawPjd(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsPjd(this).draw(opts, snapList);
  }

  /**
     * 变电站修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  editBdz(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsBdz(this).edit(opts, snapList);
  }

  /**
     * 架空线路修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     * @param {Array} ignoreSbzlx 捕捉图形中不包含该数组中设备子类型设备
     */
  editJkxl(option, snapList, ignoreSbzlx) {
    let opts = Object.assign({}, this.option, option);
    return new PmsJkxl(this).edit(opts, snapList, ignoreSbzlx);
  }

  /**
     * 电力电缆修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     * @param {Array} ignoreSbzlx 捕捉图形中不包含该数组中设备子类型设备
     */
  editDldl(option, snapList, ignoreSbzlx) {
    let opts = Object.assign({}, this.option, option);
    return new PmsDldl(this).edit(opts, snapList, ignoreSbzlx);
  }

  /**
     * 开关站修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  editKgz(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsKgz(this).edit(opts, snapList);
  }

  /**
     * 环网柜修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  editHwg(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsHwg(this).edit(opts, snapList);
  }

  /**
     * 电缆分支箱修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  editDlfzx(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsDlfzx(this).edit(opts, snapList);
  }

  /**
     * 柱上断路器修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  editZsdlq(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsZsdlq(this).edit(opts, snapList);
  }

  /**
     * 柱上负荷开关修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  editZsfhkg(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsZsfhkg(this).edit(opts, snapList);
  }

  /**
     * 电缆廊道修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  editDlld(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsDlld(this).edit(opts, snapList);
  }

  /**
     * 柱上变压器修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
  editZsbyq(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsZsbyq(this).edit(opts, snapList);
  }

  /**
     * 箱式变电站修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
   editXsbdz(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsXsbdz(this).edit(opts, snapList);
  }

  /**
     * 配电室修改
     * @param {Object} option 默认参数
     * @param {Array} snapList 捕捉图形
     */
   editPds(option, snapList) {
    let opts = Object.assign({}, this.option, option);
    return new PmsPds(this).edit(opts, snapList);
  }
}

export default PowerGridTool;
